package name.fowler.refactoring.simplestore.domain;

public enum PriceCodes {
	Regular{
        @Override
        public double getAmount(int daysRented) {
            double res = 2;
            if (daysRented > 2) {
                res += (daysRented - 2) * 1.5;
            }
            return res;
        }
    },
	NewRelease{
        @Override
        public double getAmount(int daysRented) {
            double res = daysRented * 3;
            return res;
        }

        @Override
        public int getFrequentPoints(int daysRented) {
            // Add frequent renter points
            int frequentRenterPoints = super.getFrequentPoints(daysRented);

            // Add bonus for a two-day new-release rental
            if (daysRented > 1)
            {
                frequentRenterPoints++;
            }
            return frequentRenterPoints;
        }
    },
	Childrens{
        @Override
        public double getAmount(int daysRented) {
            double res = 1.5;
            if (daysRented > 3)
            {
                res = (daysRented - 3) * 1.5;
            }
            return res;
        }
    };

    public double getAmount(int daysRented) {
        return 0.0;
    }

    public int getFrequentPoints(int daysRental) {
        // Add frequent renter points
        return 1;
    }

}
